# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-dnsrobocert
pkgver=3.20.1
pkgrel=1
pkgdesc="A tool to manage your DNS-challenged TLS certificates"
url="https://dnsrobocert.readthedocs.io/en/latest/"
arch="noarch"
license="MIT"
depends="
	certbot
	py3-acme
	py3-boto3
	py3-cffi
	py3-cryptography
	py3-colorama
	py3-coloredlogs
	py3-dnspython
	py3-dns-lexicon
	py3-jsonschema
	py3-localzone
	py3-lxml
	py3-openssl
	py3-pem
	py3-schedule
	py3-softlayer
	py3-softlayer-zeep
	py3-tldextract
	py3-xmltodict
	py3-yaml
	"
makedepends="
	py3-build
	py3-installer
	py3-poetry-core
	"
checkdepends="pebble py3-pytest"
source="$pkgname-$pkgver.tar.gz::https://github.com/adferrand/dnsrobocert/archive/v$pkgver.tar.gz
	pebble.patch
	"
builddir="$srcdir/dnsrobocert-$pkgver"

build() {
	# XXX: hack for poetry to not ignore files
	GIT_DIR=. python3 -m build --no-isolation --wheel
}

check() {
	python3 -m installer -d testenv \
		dist/dnsrobocert-$pkgver-py3-none-any.whl
	local sitedir="$(python3 -c 'import site;print(site.getsitepackages()[0])')"
	PYTHONPATH="$PWD/testenv/$sitedir" python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/dnsrobocert-$pkgver-py3-none-any.whl
}

sha512sums="
6c987772b67a6a9f56b1410b2d79c59b11f1be62f6d00e5dd5ed6ee14afe232d7e1b69b0d43722cb704ed22bca43458612692fa87997b0dceafa1bca5b12e177  py3-dnsrobocert-3.20.1.tar.gz
3a8f2d9a74a35aea2e5eebcede656d2861382c975dc94560eca4f94cd8b13f1bb4a98b5b667cb5937ef9123a8f1da20dcef58a8ffc903e93e979d928bca9f9b1  pebble.patch
"
